package cn.tedu._03vehicle.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
public class UserRegParam {
    @NotNull
    @NotEmpty(message = "用户名不能为空字符串和null")
    @NotBlank(message = "")
    @Pattern(
            regexp = "^(?=[\\x21-\\x7E]{8,14}$)(?:(?=.*?[a-zA-Z])(?=.*?[0-9])|(?=.*?[a-zA-Z])(?=.*?[\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E])|(?=.*?[0-9])(?=.*?[\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E])).*",
            message = "用户名必须为8-14个字符，包含字母、数字、标点符号中至少两种，且不允许空格或中文"
    )
    @Schema(description = "用户名",required=true)
    private String username;
    @Schema(description = "密码",required=true)
    private String password;
    @Schema(description = "邮箱",required=true)
    private String email;
    @Schema(description = "手机号码",required=true)
    private String phone;
}
